package com.whh.downloader.model;

import java.util.List;

import com.whh.downloader.Constant;

/**
 * 英雄
 * 
 * @author WHH
 * 
 */
public class Hero {
	private Long id;
	private Integer level;// 等级
	private Integer group;// 阵营：天辉、夜魇
	private Integer type; // 英雄类型:智力、敏捷、力量
	private String roles; // 角色,多个用"-"间隔
	private String nameCn;// 中文名称
	private String nameEn;// 英文名称
	private String nameShort;// 简称
	private String headerSb;// 小图
	private String headerVert;// 超大图
	private Integer intelligence;// 智力
	private Double intelligenceIncrease;// 智力成长
	private Integer agility;// 敏捷
	private Double agilityIncrease;// 敏捷成长;
	private Integer strength;// 力量
	private Double strengthIncrease;// 力量成长
	private Integer attackMin;// 最小攻击
	private Integer attackMax;// 最大攻击
	private Integer attackType; // 攻击类型
	private Double defense; // 防御
	private Integer moveSpeed;// 移速
	private Integer sightRangeNight;// 晚上视野范围
	private Integer sightRangeDay;// 白天视野范围
	private Integer attackRange;// 攻击范围
	private Integer missileSpeed;// 弹道速度
	private Double castPoint;	//施法前摇
	private Double castBackswing;//施法后摇
	private Double attackPoint;//攻击前摇
	private Double attackBackswing;//攻击后摇
	private Double attackTime;	//攻击间隔
	private String bio; // 背景故事
	
	/**以下为计算所得**/
	private Integer hp;// 血量
	private Integer mana;// 蓝量
	private Integer damageMin;// 最小伤害
	private Integer damageMax;// 最大伤害
	private Double armor;// 护甲
	
	private List<Ability> abilities;// 技能

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getRoles() {
		return roles;
	}

	public void setRoles(String roles) {
		this.roles = roles;
	}

	public Integer getGroup() {
		return group;
	}

	public void setGroup(Integer group) {
		this.group = group;
	}

	public String getNameCn() {
		return nameCn;
	}

	public void setNameCn(String nameCn) {
		this.nameCn = nameCn;
	}

	public String getNameEn() {
		return nameEn;
	}

	public void setNameEn(String nameEn) {
		this.nameEn = nameEn;
	}

	public String getNameShort() {
		return nameShort;
	}

	public void setNameShort(String nameShort) {
		this.nameShort = nameShort;
	}

	public String getHeaderSb() {
		return headerSb;
	}

	public void setHeaderSb(String headerSb) {
		this.headerSb = headerSb;
	}

	public String getHeaderVert() {
		return headerVert;
	}

	public void setHeaderVert(String headerVert) {
		this.headerVert = headerVert;
	}

	public Integer getIntelligence() {
		return intelligence + (int) ((level - 1) * intelligenceIncrease);
	}

	public void setIntelligence(Integer intelligence) {
		this.intelligence = intelligence;
	}

	public Double getIntelligenceIncrease() {
		return intelligenceIncrease;
	}

	public void setIntelligenceIncrease(Double intelligenceIncrease) {
		this.intelligenceIncrease = intelligenceIncrease;
	}

	public Integer getAgility() {
		return agility + (int) ((level - 1) * agilityIncrease);
	}

	public void setAgility(Integer agility) {
		this.agility = agility;
	}

	public Double getAgilityIncrease() {
		return agilityIncrease;
	}

	public void setAgilityIncrease(Double agilityIncrease) {
		this.agilityIncrease = agilityIncrease;
	}

	public Integer getStrength() {
		return strength + (int) ((level - 1) * strengthIncrease);
	}

	public void setStrength(Integer strength) {
		this.strength = strength;
	}

	public Double getStrengthIncrease() {
		return strengthIncrease;
	}

	public void setStrengthIncrease(Double strengthIncrease) {
		this.strengthIncrease = strengthIncrease;
	}

	public Integer getDamageMin() {
		if (type.equals(Constant.HERO_TYPE_INT)) {
			damageMin = attackMin + getIntelligence();
		} else if (type.equals(Constant.HERO_TYPE_AGI)) {
			damageMin = attackMin + getAgility();
		} else if (type.equals(Constant.HERO_TYPE_STR)) {
			damageMin = attackMin + getStrength();
		}
		return damageMin;
	}

	public Integer getDamageMax() {
		
		if (type.equals(Constant.HERO_TYPE_INT)) {
			damageMax = attackMax + getIntelligence();
		} else if (type.equals(Constant.HERO_TYPE_AGI)) {
			damageMax = attackMax + getAgility();
		} else if (type.equals(Constant.HERO_TYPE_STR)) {
			damageMax = attackMax + getStrength();
		}
		return damageMax;
	}

	public Integer getAttackType() {
		return attackType;
	}

	public void setAttackType(Integer attackType) {
		this.attackType = attackType;
	}

	public Integer getMoveSpeed() {
		return moveSpeed;
	}

	public void setMoveSpeed(Integer moveSpeed) {
		this.moveSpeed = moveSpeed;
	}

	public Double getArmor() {
		armor = defense + ((level - 1) * agilityIncrease / 7);
		return armor;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Integer getHp() {
		hp = 150 + getStrength()*19;
		return hp;
	}

	public Integer getMana() {
		mana = getIntelligence()*13;
		return mana;
	}

	public Integer getSightRangeNight() {
		return sightRangeNight;
	}

	public void setSightRangeNight(Integer sightRangeNight) {
		this.sightRangeNight = sightRangeNight;
	}

	public Integer getSightRangeDay() {
		return sightRangeDay;
	}

	public void setSightRangeDay(Integer sightRangeDay) {
		this.sightRangeDay = sightRangeDay;
	}

	public Integer getAttackRange() {
		return attackRange;
	}

	public void setAttackRange(Integer attackRange) {
		this.attackRange = attackRange;
	}

	public Integer getMissileSpeed() {
		return missileSpeed;
	}

	public void setMissileSpeed(Integer missileSpeed) {
		this.missileSpeed = missileSpeed;
	}

	public String getBio() {
		return bio;
	}

	public void setBio(String bio) {
		this.bio = bio;
	}

	public List<Ability> getAbilities() {
		return abilities;
	}

	public void setAbilities(List<Ability> abilities) {
		this.abilities = abilities;
	}

	public Integer getAttackMin() {
		return attackMin;
	}

	public void setAttackMin(Integer attackMin) {
		this.attackMin = attackMin;
	}

	public Integer getAttackMax() {
		return attackMax;
	}

	public void setAttackMax(Integer attackMax) {
		this.attackMax = attackMax;
	}

	public Double getDefense() {
		return defense;
	}

	public void setDefense(Double defense) {
		this.defense = defense;
	}

	public Double getCastPoint() {
		return castPoint;
	}

	public void setCastPoint(Double castPoint) {
		this.castPoint = castPoint;
	}

	public Double getCastBackswing() {
		return castBackswing;
	}

	public void setCastBackswing(Double castBackswing) {
		this.castBackswing = castBackswing;
	}

	public Double getAttackPoint() {
		return attackPoint;
	}

	public void setAttackPoint(Double attackPoint) {
		this.attackPoint = attackPoint;
	}

	public Double getAttackBackswing() {
		return attackBackswing;
	}

	public void setAttackBackswing(Double attackBackswing) {
		this.attackBackswing = attackBackswing;
	}

	public Double getAttackTime() {
		return attackTime;
	}

	public void setAttackTime(Double attackTime) {
		this.attackTime = attackTime;
	}

	public void setHp(Integer hp) {
		this.hp = hp;
	}

	public void setMana(Integer mana) {
		this.mana = mana;
	}

	public void setDamageMin(Integer damageMin) {
		this.damageMin = damageMin;
	}

	public void setDamageMax(Integer damageMax) {
		this.damageMax = damageMax;
	}

	public void setArmor(Double armor) {
		this.armor = armor;
	}

}
